$(function() {
	$("#header").load('header.html', function() {loadHeader(5)});
	$("#footer").load('footer.html', function(data, status, xhr) {});
	$("#tab").load('tab.html', function(data, status, xhr) {});
//获取url中的参数
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
var r = window.location.search.substr(1).match(reg); //匹配目标参数
if (r != null) return unescape(r[2]); return null; //返回参数值
}
//接收URL中的参数
var id = getUrlParam('IptId');
console.log(id);


$.ajax({
	url: host +'/MtmlAPI/ActiveDetail',
	type: 'POST',
	dataType: 'JSON',
	data: {
		id: id,
		cid:cid
	},

	success: function(res) {
		var obj = res.data
		if(res.state) {
				$('.good-detail').append(
				`
				<div class="good-detail-pro">
					<div class='good-detail-img' style='background-image:url(${obj.image[0]})'></div>
					<div class="good-detail-txt">
						<div class="good-detail-good">${obj.title}</div>
						<div class='good-detail-tib'>
							<div>美丽保</div><div>享分期</div><div>速退款</div>
						</div>
						<ul class="good-detail-pro-txt">
							<li>原价: ￥${obj.oriPrice}</li>
							<li class='good-detail-miaosha'>美丽价: ￥${obj.price}</li>
						</ul>
						<div class='good-detail-address'>
							<i class="iconfont icon-location"></i>
							<span>${obj.adress}</span>
						</div>
					</div>
				</div>
				<div  class='good-detail-content'>${obj.content}</div>
				`
				);
//								<div class="button good-detail-compra"><a>立即购买</a></div>
				
		} else {

		}
	},
	error: function() {}
});
});
